// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 启用路由
Vue.use(Router);


// 导出路由 
export default new Router({
  routes: [{
    path: '/',
    name: '',
    component: () => import('@/views/login'),
    hidden: true,
  }, {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login'),
    hidden: true,
    meta: {
      title: '登录'
    }
  }, {
    path: '/',
    name: '',
    component: () => import('@/views/index'),
    children: [
      {
        path: 'home',
        name: 'home',
        component: () => import('@/views/home'),
        meta: {
          title: '一张图',
          icon: 'icon-shouye'
        }
      }
    ]
  },  {
    path: '/sys',
    name: 'sys',
    component: () => import('@/views/index'),
    children: [
      {
        path: 'userManage',
        name: 'user-manage',
        component: () => import('@/views/sys/user-manage/list'),
        meta: {
          title: '用户管理',
          icon: 'icon-yonghuguanli'
        }
      }, {
        path: 'roleManage',
        name: 'role-manage',
        component: () => import('@/views/sys/role-manage/list'),
        meta: {
          title: '角色管理',
          icon: 'icon-jiaoseguanli'
        }
      }, {
        path: 'menuManage',
        name: 'menu-manage',
        component: () => import('@/views/sys/menu-manage/list'),
        meta: {
          title: '菜单管理',
          icon: 'icon-caidanguanli'
        }
      }, {
        path: 'dictManage',
        name: 'dict-manage',
        component: () => import('@/views/sys/dict-manage/list'),
        meta: {
          title: '字典管理',
          icon: 'icon-caidanguanli'
        }
      }, {
        path: 'organManage',
        name: 'organ-manage',
        component: () => import('@/views/sys/organ-manage/list'),
        meta: {
          title: '组织机构',
          icon: 'icon-zuzhijigou'
        }
      }
    ]
  }, {
    path: '/reloadPage',
    name: 'reload-page',
    meta: {
      oneTab: false
    },
    component: () => import("@/views/reload.vue")
  }]
})